home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / Advanced_Math_Samples / f_pareto < prev    next >
Encoding:
Text File  |  2005-03-02  |  1.1 KB  |  45 lines

  1. 10!   The following is a test of the HTBasic math "runtime"
  2. 20!  libary function: F_pareto
  3. 30! File: F_pareto.prg
  4. 50! Comments: Probability density for Pareto distribution.
  5. 60    CLEAR SCREEN
  6. 70    LOADSUB ALL FROM "..\mathlib\Mathlib.hts"
  7. 80    GINIT
  8. 90    Function$="F_pareto"
  9. 100   X_left=1
  10. 110   X_right=5
  11. 120   Y_bottom=0
  12. 130   Y_top=2
  13. 140   X_tick=1
  14. 150   Y_tick=.5
  15. 160   Xo=1
  16. 170   T=2
  17. 180   Precision=.1
  18. 190   PRINT Function$,"example"
  19. 200   PRINT "x, y"
  20. 210   VIEWPORT 40,120,20,90
  21. 220   WINDOW X_left,X_right,Y_bottom,Y_top
  22. 230   FRAME
  23. 240   AXES X_tick,Y_tick
  24. 250   PEN 6
  25. 260! Draw graph
  26. 270   FOR Loop=X_left TO X_right STEP Precision
  27. 280     PLOT Loop,FNF_pareto(Xo,T,Loop)
  28. 290     IF Loop MOD X_tick=0 THEN
  29. 300       PRINT Loop,FNF_pareto(Xo,T,Loop)  ! place function here.
  30. 310     END IF
  31. 320   NEXT Loop
  32. 330! Draw labels
  33. 340   CSIZE 3
  34. 350   PEN 1
  35. 360   FOR Loop=X_left TO X_right STEP X_tick
  36. 370     MOVE Loop,0
  37. 380     LABEL Loop
  38. 390   NEXT Loop
  39. 400   FOR Loop=Y_bottom TO Y_top STEP Y_tick
  40. 410     MOVE 0,Loop
  41. 420     LABEL Loop
  42. 430   NEXT Loop
  43. 440   DELSUB FNAi TO END
  44. 450   END
  45.